package String.homework;

//有这样一个字符串(也可以键盘录入)  String s = "HJHKJHJHkhgjhgjhgjhgJGGUYGUYTGUY565765767687$^%$%$%$^%&97u98"
//				请统计 大写字符有多少个  小写字母有多少个 数字字母有多少个   其他字符有多少个。
public class Work3 {
    public static void main(String[] args) {
        String s = "HJHKJHJHkhgjhgjhgjhgJGGUYGUYTGUY565765767687$^%$%$%$^%&97u98";
        char[] chars = s.toCharArray();
        int big = 0;
        int small = 0;
        int sum = 0;
        int k = 0;
        for (int i = 0; i < s.length(); i++) {
            if (chars[i] <= 'Z' && chars[i] >= 'A') {
                big++;
            } else if (chars[i] <= 'z' && chars[i] >= 'a') {
                small++;
            } else if (chars[i] <= '9' && chars[i] >= '0') {
                sum++;
            } else {
                k++;
            }
        }
        System.out.println("大写字符：" + big + " 小写字符：" + small + " 数字字符：" + sum + " 其他字符：" + k);
    }
}
